<template>
  <div
    :class="prefixCls"
    class="relative h-[100%] lt-md:px-10px lt-sm:px-10px lt-xl:px-10px lt-xl:px-10px bg-[#001440]"
  >
    <div class="relative mx-auto h-full flex">
      <div
        :class="`${prefixCls}__left flex-1 relative p-30px lt-xl:hidden overflow-x-hidden overflow-y-auto`"
      >
        <!-- 左上角的 logo + 系统标题 -->
        <div class="relative flex items-center text-white">
          <img alt="" class="mr-10px h-48px w-48px" src="@/assets/imgs/logo.png" />
          <span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
        </div>
        <!-- 左边的背景图 + 欢迎语 -->
        <div class="h-[calc(100%-60px)] flex items-center justify-center">
          <TransitionGroup
            appear
            enter-active-class="animate__animated animate__bounceInLeft"
            tag="div"
            class="relative"
          >
            <img key="1" alt="" class="w-[450px]" src="@/assets/svgs/login-box-bg.svg" />
            <!-- <div key="2" class="text-3xl text-white absolute top-[40%] left-[50%] transform -translate-x-1/2 -translate-y-1/2">{{ t('login.welcome') }}</div>
            <div key="3" class="mt-5 text-14px font-normal text-white absolute top-[50%] left-[50%] transform -translate-x-1/2 -translate-y-1/2">
              {{ t('login.message') }}
            </div> -->
          </TransitionGroup>
        </div>
      </div>
      <div
        class="relative flex-1 p-30px dark:bg-transparent lt-sm:p-10px overflow-x-hidden overflow-y-auto"
      >
        <!-- 右边的登录界面 -->
        <Transition appear enter-active-class="animate__animated animate__bounceInRight">
          <div
            class="m-auto h-[calc(100%-60px)] w-[100%] flex items-center at-2xl:max-w-500px at-lg:max-w-500px at-md:max-w-500px at-xl:max-w-500px"
          >
            <!-- 账号登录 -->
            <LoginForm
              class="m-auto h-auto p-20px lt-xl:(rounded-3xl light:bg-[#fff] bg-opacity-1)"
            />
          </div>
        </Transition>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { underlineToHump } from '@/utils'

import { useDesign } from '@/hooks/web/useDesign'
import { useAppStore } from '@/store/modules/app'

import { LoginForm } from './components'

defineOptions({ name: 'Login' })

const appStore = useAppStore()
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('login')
</script>

<style lang="scss" scoped>
$prefix-cls: #{$namespace}-login;

.#{$prefix-cls} {
  overflow: auto;
  background-color: #001440;

  &__left {
    &::before {
      position: absolute;
      top: 0;
      left: 0;
      z-index: -1;
      width: 100%;
      height: 100%;
      background-image: url('@/assets/svgs/login-bg.svg');
      background-position: center;
      background-repeat: no-repeat;
      content: '';
    }
  }
}
</style>

<style lang="scss">
.dark .login-form {
  .el-divider__text {
    background-color: transparent;
  }

  .el-card {
    background-color: rgb(12 58 90 / 5%);
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 8px;
  }

  .el-input__wrapper {
    background-color: rgb(255 255 255 / 5%);
    border: 1px solid rgb(255 255 255 / 10%);
    box-shadow: none;
  }

  .el-input__inner {
    color: #fff;
  }

  .el-checkbox__label {
    color: #fff;
  }

  .el-button--primary {
    background-color: #18b3b3;
    border-color: #18b3b3;
  }
}
</style>
